/* $Log: /NAA/Utils.htm $

4 25/05/00 16:28 Gregs

Added Netscape v. 4.73 to list of recognised browsers in BrowserType()

3 8/05/00 15:52 Michaelh

Encode URLs so Netscape can understand provenance links

2 1/05/00 15:21 Michaelh

Initial version

*/ function BrowserType() { var a; a = "" + navigator.appName + "^" + navigator.appVersion; if (a.indexOf("MSIE 5.5") != -1) return("I"); else if (a.indexOf("MSIE 5.0") != -1) return("I"); else if (a.indexOf("MSIE 4") != -1) return("I"); else if (a.indexOf("Netscape^5.0") != -1) return("N"); else if (a.indexOf("Netscape^4.72") != -1) return("N"); else if (a.indexOf("Netscape^4.73") != -1) return("N"); else if (a.indexOf("Netscape^4.08") != -1) return("N"); else { window.alert("Browser version not supported"); return("X"); } } function Disable(obj) { // Disable a text box obj.disabled = true; if (BrowserType() == "I") obj.style.backgroundColor = window.document.bgColor; } function Enable(obj) { // Enable a text box obj.disabled = false; if (BrowserType() == "I") obj.style.backgroundColor = "WHITE"; } function ReplaceSpaces(strInput) { // Replace spaces with + strInput = "" + strInput; strInput = strInput.replace(/ /g, "+"); return(strInput); } function OpenTop(strDest) { // Open a new document, replacing the whole contents of the current browser top.location.href = ReplaceSpaces(strDest); } function OpenWindow(strDest) { // Open a new document, replacing the whole contents of the current // window. Note that if the window is a frame then the current frame // will have its contents replaced. window.location.href = ReplaceSpaces(strDest); } function OpenFrame(objFrame, strDest) { // Open a new document, replacing the whole contents of the nominated frame. // For example, OpenFrame(parent.f1, "x.htm") will replace the contents of the // f1 frame with the contents of X.htm. Note that there are no quotes around // the first argument, and it must always be preceded by parent. objFrame.location.href = ReplaceSpaces(strDest); } function NewBrowser(strDest, strName) { // Open a window in a new browser session. strName is a name for the window. // The new window is NOT modal. window.open(ReplaceSpaces(strDest), strName); }